package com.carlinfo.stu_ques.demo.pojo;

import java.io.Serializable;
import java.util.Date;

import com.carlinfo.stu_ques.common.util.DateUtil;

/**
 * 这是皇上类
 */
public class King implements Serializable {
	private int id;
	private int dynastyId;
	private String name;
	private short age;
	private double height;
	private String miaoHao;
	private String nianHao;
	private Date createTime;
	private Date updateTime;
	private Dynasty dynasty;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getDynastyId() {
		return dynastyId;
	}

	public void setDynastyId(int dynastyId) {
		this.dynastyId = dynastyId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public short getAge() {
		return age;
	}

	public void setAge(short age) {
		this.age = age;
	}

	public double getHeight() {
		return height;
	}

	public void setHeight(double height) {
		this.height = height;
	}

	public String getMiaoHao() {
		return miaoHao;
	}

	public void setMiaoHao(String miaoHao) {
		this.miaoHao = miaoHao;
	}

	public String getNianHao() {
		return nianHao;
	}

	public void setNianHao(String nianHao) {
		this.nianHao = nianHao;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	
	public Dynasty getDynasty() {
		return dynasty;
	}
	
	public void setDynasty(Dynasty dynasty) {
		this.dynasty = dynasty;
	}

	@Override
	public String toString() {
		DateUtil dateUtil = new DateUtil();
		String dyName = "无";
		if(getDynasty()!=null) {
			dyName = getDynasty().getName();
		}
		/* id,朝代Id,名字,年龄,身高,庙号,年号,创建时间,更新时间 */
		return getId() + "\t" + dyName + "\t" + getName() + "\t" + getAge() + "\t" + getHeight() + "\t"
				+ getMiaoHao() + "\t" + getNianHao() + "\t" + dateUtil.dateTimeToStr(getCreateTime()) + "\t"
				+ dateUtil.dateTimeToStr(getUpdateTime());
	}


}
